﻿Imports ML.Framework.Collections

Public Class Album

    Private _Artists As ReadOnlyCollection(Of SongArtist)
    Private _Name As String
    Private _Tracks As ReadOnlyCollection(Of IAudioMediaFile)

    Public ReadOnly Property Artists() As IEnumerable(Of SongArtist)
        Get
            Return _Artists
        End Get
    End Property

    Public ReadOnly Property Name() As String
        Get
            Return _Name
        End Get
    End Property

    Public ReadOnly Property Tracks() As IEnumerable(Of IAudioMediaFile)
        Get
            Return _Tracks
        End Get
    End Property

    Public Sub New(ByVal Artists As IEnumerable(Of SongArtist), ByVal Tracks As ISortableCollection(Of IAudioMediaFile))
        _Artists = New ReadOnlyCollection(Of SongArtist)(Artists)
        For Each track As IMediaFile In Tracks.SortBy(New SortCriteria(Of IAudioMediaFile)(New AudioFileTrackNumberComparer(), SortDirection.Asc))
            _Tracks.Add(track)
        Next
    End Sub

End Class
